﻿using System.Windows;

namespace 属性
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += MainWindow_Loaded;
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // 属性依赖注入
            Car car = new Car();
            car.Engine = new Constructor();
            car.Drive();
        }
    }
}
